import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.Socket;

public class TestConnector {

	public static void main(String arg[]) {
		try {
			OutputStream os;
			ObjectOutputStream oos;
			int max = 0;
			Socket myClient;
			while (max < 100) {
				myClient = new Socket("127.0.0.1", 12347);

				System.out
						.println("ServerConnector.java--------------------------" + 2);

				// write to server
				os = myClient.getOutputStream();
				oos = new ObjectOutputStream(os);

				oos.writeObject(null);
				System.out
						.println("ServerConnector.java--------------------------" + 3);

				// clearing msg to insert response msg from server.

				// // read from server
				// InputStream input = myClient.getInputStream();
				// ObjectInputStream ois = new ObjectInputStream(input);
				// System.out
				// .println("ServerConnector.java--------------------------" +
				// 4);
				// msg = (ClientMessage) ois.readObject();
				// System.out
				// .println("ServerConnector.java--------------------------" +
				// 5);
				max++;

				oos.close();
				os.close();
			}
			// ois.close();
			// input.close();

		} catch (Exception e) {
			System.out.println("connection to server failed " + e);
		}
	}
}
